package com.test.spring.aop.annotation;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2018/9/27 18:14
 */
public class Main {
    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("aop-context.xml");
        ArithmeticCalculator calculator = ctx.getBean("arithmeticCalculator", ArithmeticCalculator.class);
        System.out.println(calculator.add(1, 2));
        System.out.println(calculator.div(8, 2));
        System.out.println(calculator.div(8, 0));
    }
}
